/*
 * @Author: qianmingtian
 * @Date: 2020-07-07 15:21:04
 * @LastEditors: qianmingtian
 * @LastEditTime: 2020-07-07 20:26:48
 * @FilePath: \qianmingtian.github.io\code\java\abstractPrac\OrderFoodTest.java
 */
package abstractPrac;

public class OrderFoodTest {
    public static void main(String[] args) {
        // 餐馆创建厨师
        FoodMenu chinesMenu = new ChineseCooker();

        FoodMenu americaMenu = new AmericanCooker();

        // 创建顾客,顾客手里有菜单
        Customer customerChinese = new Customer(chinesMenu);

        Customer customerAmerican = new Customer(americaMenu);
        // 顾客点菜

        customerChinese.order();
        customerAmerican.order();

        System.out.println(customerAmerican.toString());
        // 默认调用 toString 方法
        System.out.println(customerAmerican);

        String s1 = "123";
        String s2 = "123";
        // s1 s2 属于引用 指向相同的内存地址
        System.out.println(s1.getClass().getName() + Integer.toHexString(Object.class.hashCode()));// java.lang.String6d06d69c

        System.out.println(s2.getClass().getName() + Integer.toHexString(Object.class.hashCode()));// java.lang.String6d06d69c
        System.out.println(s1 == s2);

    }
}